#!/bin/bash

if [ "$(whoami)" != "root" ]; then 
	echo "Please run this script as root!"; 
	exit 1; 
fi 

apt-get install npm nodejs yui-compressor gettext
npm install
npm install -g uglify-js
npm install -g less

if [ "$(which node)" == "" ]; then 
	NODEJS=$(which nodejs)
	if [ "$NODEJS" != "" ]; then 
		read -p "Found nodejs executable at $(which nodejs), but no path to 'node'. Do you want to create a symlink? (y/n): " ans
		if [ "$ans" == "y" ]; then
			ln -s "$NODEJS" "/usr/bin/node"
		fi
	fi
fi

